from django.test import TestCase

# Create your tests here.

def upload():
    from sdks.aliyunsdkcore import client
    from sdks.aliyunsdksts.request.v20150401 import AssumeRoleRequest

    clt = client.AcsClient('LTAIpwMUwSv5GRI8', 'YRjEePQDqORjMcRlWn5CkcXnTxeggN', 'cn-beijing')

    # 构造"AssumeRole"请求
    request = AssumeRoleRequest.AssumeRoleRequest()

    # 指定角色
    request.set_RoleArn('acs:ram::1937041406315557:role/super')

    # 设置会话名称，审计服务使用此名称区分调用者
    request.set_RoleSessionName('sdjifew')

    # request.set_method('HMAC-SHA1')
    print(request)
    # 发起请求，并得到response
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
    response = clt.do_action_with_exception(request)
    print(response)

upload()